<?php
class Cms_View_Helper_MyDojo
{
    public $view;

    public function mydojo()
    {
    	$CONFIG = Zend_Registry::get('config');
    
    	if($CONFIG->mode == 'development'){
    		$this->view->dojo()->setLocalPath('/mvc/scripts/dojo/dojo/dojo.js')
							   ->setDjConfigOption('usePlainJson', 'true')
							   ->requireModule('dev.form.AddContentButton');
							  
    	} else {
    		$this->view->dojo()->setLocalPath('/mvc/scripts/dojo/release/dojo/dojo/dojo.js')
    						   ->setDjConfigOption('usePlainJson', 'true')
							   ->addStyleSheetModule('dijit.themes.soria')
							   ->addLayer('/mvc/scripts/dojo/release/dojo/dojo/adminMenu.js')
							   ->requireModule('dev.form.AddContentButton')
							   ->requireModule('dijit.Menu')
							   ;
    }	
		Zend_Dojo_View_Helper_Dojo::setUseDeclarative();
		
		return $this->view->dojo();
    }

    public function setView(Zend_View_Interface $view)
    {
        $this->view = $view;
    }
	
	public function lcfirst($str) 
	{
    	return strtolower(substr($str, 0, 1)) . substr($str, 1);
	}
}